home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / hanson.zip / FILPS.C < prev    next >
Text File  |  1985-12-31  |  512b  |  29 lines

  1. /* version.c by Michael Hanson */
  2. /* you may use this, but not for profit, and give me credit */ 
  3. /* file procedure for dos 2.0 */
  4. /* allows redirection of STDIN to work (dosn't hang on EOF) */
  5. static int inchar,filn;
  6.  
  7. getc(filno)
  8. FILE filno;
  9. {
  10.     filn=filno;
  11. #asm
  12.         DSEG
  13. INCHAR    DW 0000H
  14.         CSEG
  15.         MOV BX,WORD filn_
  16.         MOV CX,01H
  17.         MOV DX,OFFSET INCHAR
  18.         MOV AH,3FH
  19.         INT 21H
  20.         JB    ERR
  21.         CMP AX,0
  22.         JE    ERR
  23.         MOV AX,INCHAR
  24.         JMP DONE
  25. ERR:    MOV AX,-1H
  26. DONE:    
  27. #
  28. }
  29.